import Vue from 'vue'
import Router from 'vue-router'

import Login from '@/views/login'
import home from '@/views/home'
import welcome from '@/views/welcome/welcome'
// 引入用户管理组件
import users from '@/views/users/users'
import rigths from '@/views/rights/rigths'
import roles from '@/views/rights/roles'
import categories from '@/views/categories/categories'
import goods from '@/views/goods/goods'
import toadd from '@/views/goods/addgoods'


Vue.use(Router)

export default new Router({
  routes: [
   {path:'/login',name:'Login',component:Login},
   {path:'/',name:'home',component:home,redirect:{path:'welcome'},
    children:[
      {
        path:'welcome',
        name:'welcome',
        component:welcome
      },
      {path:'/users',name:'user',component:users},
      {path:'/rights',name:'rigths',component:rigths},
      {path:'/roles',name:'roles',component:roles},
      {path:'/categories',name:'categories',component:categories},
      {path:'/goods',name:'goods',component:goods},
      {path:'/toadd',name:'toadd',component:toadd}
    ]
   },
   
  ]
})
